﻿/*
using MyGeneration/Template/NHibernate (c) by Sharp 1.4
based on OHM (alvy77@hotmail.com)
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace DomainModel
{

    /// <summary>
    /// IWebInfomationPublish interface for NHibernate mapped table 'WebInfomationPublish'.
    /// </summary>
    public interface IWebInfomationPublish
    {
        #region Public Properties

        int Wi_id
        {
            get;
            set;

        }

        string Wi_title0
        {
            get;
            set;

        }

        string Wi_title1
        {
            get;
            set;

        }

        string Wi_content
        {
            get;
            set;

        }

        string Wi_imageUrl
        {
            get;
            set;

        }

        string Wi_imageLink
        {
            get;
            set;

        }

        string Wi_dataLink
        {
            get;
            set;

        }

        byte Wi_template
        {
            get;
            set;

        }

        int? Wi_recommend
        {
            get;
            set;

        }

        byte Wi_state
        {
            get;
            set;

        }

        string Wi_classRule
        {
            get;
            set;

        }

        string Wi_userRule
        {
            get;
            set;

        }

        DateTime Wi_startTime
        {
            get;
            set;

        }

        DateTime Wi_endTime
        {
            get;
            set;

        }

        int Wi_user
        {
            get;
            set;

        }

        DateTime Wi_addTime
        {
            get;
            set;

        }

        int? Wi_lastUser
        {
            get;
            set;

        }

        DateTime? Wi_updateTime
        {
            get;
            set;

        }

        bool IsDeleted { get; set; }
        bool IsChanged { get; set; }

        #endregion
    }

    /// <summary>
    /// WebInfomationPublish object for NHibernate mapped table 'WebInfomationPublish'.
    /// </summary>
    [Serializable]
    public class WebInfomationPublish : ICloneable, IWebInfomationPublish
    {
        #region Member Variables

        protected int _wi_id;
        protected string _wi_title0;
        protected string _wi_title1;
        protected string _wi_content;
        protected string _wi_imageurl;
        protected string _wi_imagelink;
        protected string _wi_datalink;
        protected byte _wi_template;
        protected int? _wi_recommend;
        protected byte _wi_state;
        protected string _wi_classrule;
        protected string _wi_userrule;
        protected DateTime _wi_starttime;
        protected DateTime _wi_endtime;
        protected int _wi_user;
        protected DateTime _wi_addtime;
        protected int? _wi_lastuser;
        protected DateTime? _wi_updatetime;
        protected bool _bIsDeleted;
        protected bool _bIsChanged;
        #endregion

        #region Constructors
        public WebInfomationPublish() { }

        public WebInfomationPublish(string pWititle0, string pWititle1, string pWicontent, string pWiimageUrl, string pWiimageLink, string pWidataLink, byte pWitemplate, int? pWirecommend, byte pWistate, string pWiclassRule, string pWiuserRule, DateTime pWistartTime, DateTime pWiendTime, int pWiuser, DateTime pWiaddTime, int? pWilastUser, DateTime? pWiupdateTime)
        {
            this._wi_title0 = pWititle0;
            this._wi_title1 = pWititle1;
            this._wi_content = pWicontent;
            this._wi_imageurl = pWiimageUrl;
            this._wi_imagelink = pWiimageLink;
            this._wi_datalink = pWidataLink;
            this._wi_template = pWitemplate;
            this._wi_recommend = pWirecommend;
            this._wi_state = pWistate;
            this._wi_classrule = pWiclassRule;
            this._wi_userrule = pWiuserRule;
            this._wi_starttime = pWistartTime;
            this._wi_endtime = pWiendTime;
            this._wi_user = pWiuser;
            this._wi_addtime = pWiaddTime;
            this._wi_lastuser = pWilastUser;
            this._wi_updatetime = pWiupdateTime;
        }

        public WebInfomationPublish(byte pWitemplate, byte pWistate, DateTime pWistartTime, DateTime pWiendTime, int pWiuser, DateTime pWiaddTime)
        {
            this._wi_template = pWitemplate;
            this._wi_state = pWistate;
            this._wi_starttime = pWistartTime;
            this._wi_endtime = pWiendTime;
            this._wi_user = pWiuser;
            this._wi_addtime = pWiaddTime;
        }

        public WebInfomationPublish(int pWiid)
        {
            this._wi_id = pWiid;
        }

        #endregion

        #region Public Properties

        public virtual int Wi_id
        {
            get { return _wi_id; }
            set { _bIsChanged |= (_wi_id != value); _wi_id = value; }

        }

        public virtual string Wi_title0
        {
            get { return _wi_title0; }
            set
            {
                if (value != null && value.Length > 200)
                    throw new ArgumentOutOfRangeException("Wi_title0", "Wi_title0 value, cannot contain more than 200 characters");
                _bIsChanged |= (_wi_title0 != value);
                _wi_title0 = value;
            }

        }

        public virtual string Wi_title1
        {
            get { return _wi_title1; }
            set
            {
                if (value != null && value.Length > 400)
                    throw new ArgumentOutOfRangeException("Wi_title1", "Wi_title1 value, cannot contain more than 400 characters");
                _bIsChanged |= (_wi_title1 != value);
                _wi_title1 = value;
            }

        }

        public virtual string Wi_content
        {
            get { return _wi_content; }
            set
            {
                if (value != null && value.Length > 2147483647)
                    throw new ArgumentOutOfRangeException("Wi_content", "Wi_content value, cannot contain more than 2147483647 characters");
                _bIsChanged |= (_wi_content != value);
                _wi_content = value;
            }

        }

        public virtual string Wi_imageUrl
        {
            get { return _wi_imageurl; }
            set
            {
                if (value != null && value.Length > 200)
                    throw new ArgumentOutOfRangeException("Wi_imageUrl", "Wi_imageUrl value, cannot contain more than 200 characters");
                _bIsChanged |= (_wi_imageurl != value);
                _wi_imageurl = value;
            }

        }

        public virtual string Wi_imageLink
        {
            get { return _wi_imagelink; }
            set
            {
                if (value != null && value.Length > 200)
                    throw new ArgumentOutOfRangeException("Wi_imageLink", "Wi_imageLink value, cannot contain more than 200 characters");
                _bIsChanged |= (_wi_imagelink != value);
                _wi_imagelink = value;
            }

        }

        public virtual string Wi_dataLink
        {
            get { return _wi_datalink; }
            set
            {
                if (value != null && value.Length > 200)
                    throw new ArgumentOutOfRangeException("Wi_dataLink", "Wi_dataLink value, cannot contain more than 200 characters");
                _bIsChanged |= (_wi_datalink != value);
                _wi_datalink = value;
            }

        }

        public virtual byte Wi_template
        {
            get { return _wi_template; }
            set { _bIsChanged |= (_wi_template != value); _wi_template = value; }

        }

        public virtual int? Wi_recommend
        {
            get { return _wi_recommend; }
            set { _bIsChanged |= (_wi_recommend != value); _wi_recommend = value; }

        }

        public virtual byte Wi_state
        {
            get { return _wi_state; }
            set { _bIsChanged |= (_wi_state != value); _wi_state = value; }

        }

        public virtual string Wi_classRule
        {
            get { return _wi_classrule; }
            set
            {
                if (value != null && value.Length > 400)
                    throw new ArgumentOutOfRangeException("Wi_classRule", "Wi_classRule value, cannot contain more than 400 characters");
                _bIsChanged |= (_wi_classrule != value);
                _wi_classrule = value;
            }

        }

        public virtual string Wi_userRule
        {
            get { return _wi_userrule; }
            set
            {
                if (value != null && value.Length > 600)
                    throw new ArgumentOutOfRangeException("Wi_userRule", "Wi_userRule value, cannot contain more than 600 characters");
                _bIsChanged |= (_wi_userrule != value);
                _wi_userrule = value;
            }

        }

        public virtual DateTime Wi_startTime
        {
            get { return _wi_starttime; }
            set { _bIsChanged |= (_wi_starttime != value); _wi_starttime = value; }

        }

        public virtual DateTime Wi_endTime
        {
            get { return _wi_endtime; }
            set { _bIsChanged |= (_wi_endtime != value); _wi_endtime = value; }

        }

        public virtual int Wi_user
        {
            get { return _wi_user; }
            set { _bIsChanged |= (_wi_user != value); _wi_user = value; }

        }

        public virtual DateTime Wi_addTime
        {
            get { return _wi_addtime; }
            set { _bIsChanged |= (_wi_addtime != value); _wi_addtime = value; }

        }

        public virtual int? Wi_lastUser
        {
            get { return _wi_lastuser; }
            set { _bIsChanged |= (_wi_lastuser != value); _wi_lastuser = value; }

        }

        public virtual DateTime? Wi_updateTime
        {
            get { return _wi_updatetime; }
            set { _bIsChanged |= (_wi_updatetime != value); _wi_updatetime = value; }

        }


        public virtual bool IsDeleted
        {
            get
            {
                return _bIsDeleted;
            }
            set
            {
                _bIsDeleted = value;
            }
        }

        public virtual bool IsChanged
        {
            get
            {
                return _bIsChanged;
            }
            set
            {
                _bIsChanged = value;
            }
        }

        #endregion

        #region Equals And HashCode Overrides
        /// <summary>
        /// local implementation of Equals based on unique value members
        /// </summary>
        public override bool Equals(object obj)
        {
            if (this == obj) return true;
            WebInfomationPublish castObj = null;
            try
            {
                castObj = (WebInfomationPublish)obj;
            }
            catch (Exception) { return false; }
            return (castObj != null) &&
                (this._wi_id == castObj.Wi_id);
        }
        /// <summary>
        /// local implementation of GetHashCode based on unique value members
        /// </summary>
        public override int GetHashCode()
        {


            int hash = 57;
            hash = 27 * hash * _wi_id.GetHashCode();
            return hash;
        }
        #endregion

        #region ICloneable methods

        public virtual object Clone()
        {
            return this.MemberwiseClone();
        }

        #endregion
    }

    #region Custom ICollection interface for WebInfomationPublish


    public interface IWebInfomationPublishCollection : ICollection
    {
        WebInfomationPublish this[int index] { get; set; }
        void Add(WebInfomationPublish pWebInfomationPublish);
        void Clear();
    }

    [Serializable]
    public class WebInfomationPublishCollection : IWebInfomationPublishCollection
    {
        private IList<WebInfomationPublish> _arrayInternal;

        public WebInfomationPublishCollection()
        {
            _arrayInternal = new List<WebInfomationPublish>();
        }

        public WebInfomationPublishCollection(IList<WebInfomationPublish> pSource)
        {
            _arrayInternal = pSource;
            if (_arrayInternal == null)
            {
                _arrayInternal = new List<WebInfomationPublish>();
            }
        }

        public WebInfomationPublish this[int index]
        {
            get
            {
                return _arrayInternal[index];
            }
            set
            {
                _arrayInternal[index] = value;
            }
        }

        public int Count { get { return _arrayInternal.Count; } }
        public bool IsSynchronized { get { return false; } }
        public object SyncRoot { get { return _arrayInternal; } }
        public void CopyTo(Array array, int index) { _arrayInternal.CopyTo((WebInfomationPublish[])array, index); }
        public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
        public void Add(WebInfomationPublish pWebInfomationPublish) { _arrayInternal.Add(pWebInfomationPublish); }
        public void Clear() { _arrayInternal.Clear(); }
        public IList<WebInfomationPublish> GetList() { return _arrayInternal; }
    }

    #endregion
}
